package com.hboxs.asl.entity;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * Created by study on 6/26/2015.
 */
@Entity
@Table(name = "xx_member_wechat")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "xx_member_wechat_sequence")
public class MemberWechat extends BaseEntity {
    private static final long serialVersionUID = -2851265305898779945L;

    private Member member;
    private String accessToken;
    private String refreshToken;
    private String openid;
    private String unionid;
    private String scope;

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(nullable = false, updatable = false)
    public Member getMember() {
        return member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    @NotNull
    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    @NotNull
    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    @NotNull
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    @NotNull
    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }
}
